<?php

class ErrorController extends Crb_Controller
{

    public function errorAction()
    {
        $errors = $this->_getParam('error_handler');
        $exception = $errors->exception;

        $ELogger = Zend_Registry::get('logger-error');
        $FBLogger = Zend_Registry::get('loggerfb');
        $ELogger->log("Exception: \n--Message:" . $exception->getMessage() . "\n--Stack trace:"  . $exception->getTraceAsString() . "\n--Dump:" . print_r($errors->request->getParams(),1),Zend_Log::ALERT);
       
        $FBLogger->log("Exception: \n--Message:" . $exception->getMessage() . "\n--Stack trace:"  . $exception->getTraceAsString() . "\n--Dump:" . print_r($errors->request->getParams(),1),Zend_Log::ALERT);       
        
switch ($errors->type) { 
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:

        // 404 error -- controller or action not found
        $this->getResponse()->setHttpResponseCode(404);
        $this->view->message = 'Страница не найдена';
        break;
    default:
        // application error 
        $this->getResponse()->setHttpResponseCode(500);
        $this->view->message = 'Internal application error';
        break;
    }
	
	$this->view->exception = $errors->exception;
	$this->view->request   = $errors->request;
    }
    
    
    public function fofAction()
    {
    	
    } 


}